﻿using MVCManage.Model;
using MVCManage.Model.Base;
using System;
using System.Collections.Generic;
using System.Data.Entity.Migrations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MVCMamage.DAL
{
    public class AuthorityDAL:BaseDAL<Authority>
    {
        User entity = new User();
        public bool Add(int rid,List<Authority> list) {
            var zhi = entity.Authority.Where(n => n.roleID == rid).ToList();
            entity.Authority.RemoveRange(zhi);
            entity.Authority.AddRange(list);
            return entity.SaveChanges()>0;

        
        }



    }
}
